Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(structure): enable published chip for live edit documents #8000

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

pedrobonamin
Copy link
Contributor

@pedrobonamin pedrobonamin commented Dec 10, 2024

Description

Enables the published chip for liveEdit documents.

Live edit documents are only editable through the published perspective, we need to enable it even if the published document doesn't exists.
For the rest of documents, validate if the published document exists.

Update actions data-testid
action tests were failing because the test id was not found, this updates them to match what we have in next .https://github.com/sanity-io/sanity/blob/next/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusBarActions.tsx#L62

What to review

Testing

Notes for release

@pedrobonamin pedrobonamin requested a review from a team as a code owner December 10, 2024 08:21
@pedrobonamin pedrobonamin requested review from cngonzalez and removed request for a team December 10, 2024 08:21
Copy link

vercel bot commented Dec 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 9:05am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 9:05am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 9:05am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 9:05am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 10, 2024 9:05am

@pedrobonamin pedrobonamin removed the request for review from cngonzalez December 10, 2024 08:21
Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Dec 10, 2024

Component Testing Report Updated Dec 10, 2024 9:00 AM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 13s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 40s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 54s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 28s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 16s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 13s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 2m 47s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 49s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 14s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 42s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 29s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 57s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

github-actions bot commented Dec 10, 2024

⚡️ Editor Performance Report

Updated Tue, 10 Dec 2024 09:02:09 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.1 efps (42ms) 17.2 efps (58ms) +17ms (+39.8%) 🔴
article (body) 59.5 efps (17ms) 53.1 efps (19ms) +2ms (+12.2%)
article (string inside object) 23.8 efps (42ms) 19.0 efps (53ms) +11ms (+25.0%) 🔴
article (string inside array) 21.3 efps (47ms) 16.7 efps (60ms) +13ms (+27.7%) 🔴
recipe (name) 43.5 efps (23ms) 27.8 efps (36ms) +13ms (+56.5%) 🔴
recipe (description) 50.0 efps (20ms) 29.4 efps (34ms) +14ms (+70.0%) 🔴
recipe (instructions) 99.9+ efps (7ms) 99.9+ efps (7ms) +1ms (-/-%)
synthetic (title) 16.4 efps (61ms) 6.9 efps (146ms) +85ms (+138.5%) 🔴
synthetic (string inside object) 17.9 efps (56ms) 7.2 efps (139ms) +83ms (+147.3%) 🔴

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 42ms 45ms 51ms 77ms 193ms 11.8s
article (body) 17ms 19ms 22ms 82ms 88ms 5.5s
article (string inside object) 42ms 45ms 52ms 157ms 160ms 7.2s
article (string inside array) 47ms 49ms 55ms 178ms 142ms 7.4s
recipe (name) 23ms 25ms 27ms 48ms 0ms 8.2s
recipe (description) 20ms 22ms 24ms 53ms 4ms 4.9s
recipe (instructions) 7ms 9ms 10ms 13ms 0ms 3.3s
synthetic (title) 61ms 64ms 81ms 216ms 839ms 14.7s
synthetic (string inside object) 56ms 60ms 70ms 471ms 1078ms 9.6s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 58ms 64ms 81ms 253ms 895ms 14.3s
article (body) 19ms 21ms 29ms 153ms 310ms 6.3s
article (string inside object) 53ms 55ms 62ms 146ms 849ms 8.5s
article (string inside array) 60ms 65ms 83ms 148ms 1368ms 9.3s
recipe (name) 36ms 38ms 42ms 57ms 20ms 9.5s
recipe (description) 34ms 36ms 41ms 129ms 30ms 6.4s
recipe (instructions) 7ms 9ms 11ms 54ms 21ms 3.7s
synthetic (title) 146ms 156ms 201ms 720ms 7190ms 23.1s
synthetic (string inside object) 139ms 149ms 170ms 757ms 6978ms 17.7s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

if (!editState?.published) {
return true
}
// If it's a live edit document the only option to edit it is through
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification 🙌

Copy link
Contributor

@juice49 juice49 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@pedrobonamin pedrobonamin merged commit 7406916 into corel Dec 10, 2024
59 checks passed
@pedrobonamin pedrobonamin deleted the corel-fix-live-edit-test branch December 10, 2024 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants